#!/usr/bin/env python
# coding=utf-8
# __author__ = 'Yunchao Ling'

import os
import shutil

filelist = os.listdir(".")
for file in filelist:
    if os.path.isfile(file) and file[-6:] == "tar.gz":
        name = file[:-7]
        # shutil.move(file,"done/pmc_id_"+id+".xml")
        # shutil.move("pmc_id_"+id+".txt","done/pmc_id_"+id+".txt")
        # os.system("tar czf " + name + ".tar.gz " + name + ".xml")
        # os.system("md5sum " + name + ".tar.gz >" + name + ".tar.gz.md5")
        # os.system("rm -rf " + name + ".xml")
        shutil.move(file,file+".complete")